The transmission of information from one device to another device occurs in all sorts of technical fields; for example, information is transmitted via data packets from one mobile phone to another, or from a server to a client, etc. Data packets can be transmitted via wire, for example, telephone line, network line, etc. Data packets can also be transmitted wirelessly, for example, using near field communication (NFC) technology, or using satellite communication technology, etc.
A data packet typically comprises a header part and a message part. The header part is used for indicating some basic information related to the data packet, such as: type of the data packet, size information (i.e. length) of the data packet, etc., which could also be understood as “metadata” or “overhead”. The message part is used for carrying the message (i.e. information) that the data packet intends to carry.
In some cases, different types of data packet may have a different size of the message part. If the data packet needs to carry the size information of the data packet, typically, the header part is used to carry this size information. The header part for example has two sections, one for indicating the type of the data packet, and another one for indicating size information of the data packet. As an example, the header part has two bytes, the first byte being for indicating type information, and the second byte for indicating the size of the data packet.